home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / ddj0796.zip / letters.796 < prev    next >
Text File  |  1996-05-22  |  1KB  |  64 lines

  1. _Letters to the Editor_
  2.  
  3.  
  4. Example 1 
  5. by Martin Brown
  6.  
  7.  
  8. (a)
  9.  
  10. ln( 1+x ) =  x  - x^2/2  + x^3/3  - ...
  11. ln(1) = 0,   ln(2) = 0.833333     max error = 0.14 ( 20% )
  12.  
  13. (b)
  14.  
  15. P{ ln( 1+x ) }  =  x*(6+x)/(6+4x)
  16. ln(1) = 0,   ln(2) = 0.7   max error = 0.00685  ( < 1% )
  17.                            rms error = 0.00258
  18.  
  19.  
  20. (c)
  21.  
  22. p'{ ln( 1+x ) } =  x*(6 + 0.7662x)/(5.9897 + 3.7658x)
  23. ln(1) = 0,    ln(2) = 0.69358     max error = 4.3E-4  ( < 0.1 % )
  24.                                   rms   = 1.5E-4
  25.  
  26. (d) 
  27.  
  28. y = x/(2+x) 
  29.  
  30. (e) 
  31.  
  32. ln( (1+y)/(1-y) ) = 2y + 2y^3/3 + 2y^5/5 + ...
  33. ln(1) = 0,   ln(2) = 0.69300      max error = -0.00014
  34.  
  35. (f)
  36.  
  37. P{ ln (1+y)/(1-y) } =  2y*(15 - 4y^2)/(15 - 9y^2)
  38. ln(1) = 0,   ln(2) = 0.693122     max error = -0.000025
  39.  
  40.  
  41. (g)
  42.  
  43. P{ sqrt(1+x) } = (4 + 3x)/(4 + x)
  44.  
  45.  
  46.  
  47. Example 2
  48. by Carl Smotricz
  49.  
  50.  
  51. /*** y = log2(x) for 1 <= x < 2 ***/
  52. #define RESULT_BITS 40  // desired accuracy
  53. s = 1.0;
  54. for (n=RESULT_BITS; n--; ) {
  55.     x *= x;
  56.     s /= 2.0;
  57.     if (x >= 2.0) {
  58.         y += s;
  59.         x /= 2.0;
  60.     }
  61. }
  62.  
  63.  
  64.